﻿<loki:ViewControl
    xmlns:lunavm="clr-namespace:Luna.UI.Budget;assembly=Luna.Core"
    xmlns:loki="clr-namespace:Loki.UI.Wpf;assembly=Loki.UI.Wpf"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:dxg="http://schemas.devexpress.com/winfx/2008/xaml/grid"
    xmlns:dxe="http://schemas.devexpress.com/winfx/2008/xaml/editors"
    xmlns:dxlc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol"
    xmlns:local="clr-namespace:Luna.UI.Wpf"
    xmlns:dxb="http://schemas.devexpress.com/winfx/2008/xaml/bars"
    xmlns:Custom="http://schemas.devexpress.com/winfx/2008/xaml/grid/themekeys"
    x:TypeArguments="lunavm:BudgetEditViewModel"
    x:Class="Luna.UI.Budget.Wpf.BudgetEditView"
    mc:Ignorable="d"
    Height="{Binding RelativeSource=
        {RelativeSource FindAncestor,
          AncestorType={x:Type ContentControl}},
          Path=ActualHeight}"
    d:DesignHeight="500" d:DesignWidth="800">
    <dxlc:LayoutControl  Orientation="Vertical" ScrollBars="None" ScrollViewer.VerticalScrollBarVisibility="Disabled" ScrollViewer.CanContentScroll="True">
        <dxlc:LayoutGroup Header="Résumé" Orientation="Vertical" View="GroupBox" IsCollapsible="True">
            <dxlc:LayoutGroup Orientation="Horizontal">
                <dxlc:LayoutItem Label="Nom">
                    <dxe:TextEdit Name="TXT_Nom" EditValue="{Binding Name, Mode=TwoWay}" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="Code">
                    <dxe:TextEdit x:Name="TXT_Code" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="Recettes">
                    <dxe:TextEdit x:Name="TXT_Recettes" />
                </dxlc:LayoutItem>
                <dxlc:LayoutItem Label="Depenses">
                    <dxe:TextEdit x:Name="TXT_Depenses" />
                </dxlc:LayoutItem>
            </dxlc:LayoutGroup>
            <dxlc:LayoutGroup>
                <dxlc:LayoutItem Label="Description">
                    <dxe:TextEdit x:Name="TXT_Description" Style="{StaticResource TextEdit_Multiline}" />
                </dxlc:LayoutItem>
            </dxlc:LayoutGroup>
        </dxlc:LayoutGroup>
        <dxlc:LayoutGroup View="Tabs">
            <dxlc:LayoutGroup Header="Recettes">
                <dxg:TreeListControl x:Name="GRD_Income" ItemsSource="{Binding Income}" dxlc:LayoutControl.AllowVerticalSizing="True" dxlc:LayoutControl.AllowHorizontalSizing="True" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" ScrollViewer.CanContentScroll="True">
                    <dxg:TreeListControl.Columns>
                        <dxg:TreeListColumn Header="Code" FieldName="Code" />
                        <dxg:TreeListColumn Header="Nom" MinWidth="400" FieldName="Nom" />
                        <dxg:TreeListColumn Header="Montant" FieldName="Montant">
                            <dxg:TreeListColumn.EditSettings>
                                <dxe:TextEditSettings Mask="c2" MaskType="Numeric" MaskCulture="fr-FR" MaskUseAsDisplayFormat="True" />
                            </dxg:TreeListColumn.EditSettings>
                        </dxg:TreeListColumn>
                        <dxg:TreeListColumn Header="%" FieldName="Percentage" />
                    </dxg:TreeListControl.Columns>
                    <dxg:TreeListControl.View>
                        <dxg:TreeListView AutoExpandAllNodes="True" AutoWidth="True" ParentFieldName="ParentID" KeyFieldName="ID" />
                    </dxg:TreeListControl.View>
                </dxg:TreeListControl>
            </dxlc:LayoutGroup>
            <dxlc:LayoutGroup Header="Dépenses">
                <dxg:TreeListControl  VerticalAlignment="Top">
                    <dxg:TreeListControl.Columns>
                        <dxg:TreeListColumn Header="Code" />
                        <dxg:TreeListColumn Header="Nom" MinWidth="400" />
                        <dxg:TreeListColumn Header="Montant" />
                        <dxg:TreeListColumn Header="%" />
                    </dxg:TreeListControl.Columns>
                    <dxg:TreeListControl.View>
                        <dxg:TreeListView AutoExpandAllNodes="True" AutoWidth="True" />
                    </dxg:TreeListControl.View>
                </dxg:TreeListControl>
            </dxlc:LayoutGroup>
        </dxlc:LayoutGroup>
    </dxlc:LayoutControl>
</loki:ViewControl>